<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateInvitationsTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateInvitationsLabel_answered}" for="answered" />
                    <h:selectOneMenu id="accepted" value="#{invitationsController.selected.answered}" title="#{bundle.CreateInvitationsTitle_answered}" >
                        <f:selectItem itemValue="False"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateInvitationsLabel_receiver}" for="receiver" />
                    <h:selectOneMenu id="receiver" value="#{invitationsController.selected.receiver}" title="#{bundle.CreateInvitationsTitle_receiver}" >
                        <f:selectItem itemValue="#{usersController.viewed}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateInvitationsLabel_sender}" for="sender" />
                    <h:selectOneMenu id="sender" value="#{invitationsController.selected.sender}" title="#{bundle.CreateInvitationsTitle_sender}" >
                        <f:selectItem itemValue="#{usersController.selected}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateInvitationsLabel_event}" for="event" />
                    <h:selectOneMenu id="event" value="#{invitationsController.selected.event}" title="#{bundle.CreateInvitationsTitle_event}" >
                        <f:selectItems value="#{eventsController.getItemsAvailableSelectOne(usersController.creator)}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{invitationsController.create}" value="#{bundle.CreateInvitationsSaveLink}" />
                <br />
                <br />
                <h:link outcome="/login.jsp" value="Back to your calendar"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
